﻿<%@ page title="" language="C#" masterpagefile="~/Admin/MasterPage.master" autoeventwireup="true" inherits="Admin_Album_Image, App_Web_3v3upi03" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Button ID="btnAddProduct" CssClass="buttonblue" runat="server" Text="Thêm hình" OnClick="btnAddProduct_Click" />
    <br />
    <br />
    <br />
    <asp:GridView ID="gvProduct" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="odsProduct" Width="100%" AllowPaging="True" AllowSorting="True" CellPadding="10" ForeColor="#333333" GridLines="None" PageSize="100" OnRowCommand="gvProduct_RowCommand">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="ProductID" HeaderText="Mã" InsertVisible="False" ReadOnly="True" SortExpression="ProductID" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Title" HeaderText="Tiêu đề" SortExpression="Title" />
            <asp:TemplateField HeaderText="Hình đại diện" SortExpression="Image">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Image") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
<%--                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Image") %>'></asp:Label>--%>
                    <asp:Image ID="Image1" runat="server" Height="50px" ImageUrl='<%# "~/UserUploads/Product/"+ Eval("Image") %>' />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:BoundField DataField="Editdate" HeaderText="Cập nhật" SortExpression="Editdate" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="Vip" HeaderText="Nổi bật" SortExpression="Vip" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:CheckBoxField>
            <asp:BoundField DataField="Order" HeaderText="Vị trí" SortExpression="Order" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="Status" HeaderText="Hiển thị" SortExpression="Status" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:CheckBoxField>
            <asp:TemplateField HeaderText="Chức năng">
                <ItemTemplate>
                    <asp:HyperLink ID="hplEdit" runat="server" NavigateUrl='<%# Eval("ProductID","~/Admin/Album/ImageDetail.aspx?ProductID={0}") %>' Font-Bold="True">Sửa</asp:HyperLink>
                    &nbsp;&nbsp;&nbsp;
                    <asp:LinkButton ID="btnXoa" runat="server" CommandArgument='<%# Eval("ProductID") %>' Font-Bold="True">Xóa</asp:LinkButton>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:ObjectDataSource ID="odsProduct" runat="server" DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetProductByCateID" TypeName="HNCDataSetTableAdapters.ProductsTableAdapter" UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="Original_ProductID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Code" Type="String" />
            <asp:Parameter Name="Title" Type="String" />
            <asp:Parameter Name="Title_en" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Description_en" Type="String" />
            <asp:Parameter Name="Content" Type="String" />
            <asp:Parameter Name="Content_en" Type="String" />
            <asp:Parameter Name="Image" Type="String" />
            <asp:Parameter Name="Link" Type="String" />
            <asp:Parameter Name="VideoUrl" Type="String" />
            <asp:Parameter Name="Price" Type="Double" />
            <asp:Parameter Name="PriceSale" Type="Double" />
            <asp:Parameter Name="CateID" Type="Int32" />
            <asp:Parameter Name="AddDate" Type="DateTime" />
            <asp:Parameter Name="Editdate" Type="DateTime" />
            <asp:Parameter Name="AddBy" Type="String" />
            <asp:Parameter Name="New" Type="Boolean" />
            <asp:Parameter Name="Vip" Type="Boolean" />
            <asp:Parameter Name="Sale" Type="Boolean" />
            <asp:Parameter Name="MetaTitle" Type="String" />
            <asp:Parameter Name="MetaDescription" Type="String" />
            <asp:Parameter Name="MetaKeywork" Type="String" />
            <asp:Parameter Name="MetaRobots" Type="String" />
            <asp:Parameter Name="Order" Type="Int32" />
            <asp:Parameter Name="Status" Type="Boolean" />
            <asp:Parameter Name="Delete" Type="Boolean" />
        </InsertParameters>
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="" Name="CateID" QueryStringField="CateID" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Code" Type="String" />
            <asp:Parameter Name="Title" Type="String" />
            <asp:Parameter Name="Title_en" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Description_en" Type="String" />
            <asp:Parameter Name="Content" Type="String" />
            <asp:Parameter Name="Content_en" Type="String" />
            <asp:Parameter Name="Image" Type="String" />
            <asp:Parameter Name="Link" Type="String" />
            <asp:Parameter Name="VideoUrl" Type="String" />
            <asp:Parameter Name="Price" Type="Double" />
            <asp:Parameter Name="PriceSale" Type="Double" />
            <asp:Parameter Name="CateID" Type="Int32" />
            <asp:Parameter Name="AddDate" Type="DateTime" />
            <asp:Parameter Name="Editdate" Type="DateTime" />
            <asp:Parameter Name="AddBy" Type="String" />
            <asp:Parameter Name="New" Type="Boolean" />
            <asp:Parameter Name="Vip" Type="Boolean" />
            <asp:Parameter Name="Sale" Type="Boolean" />
            <asp:Parameter Name="MetaTitle" Type="String" />
            <asp:Parameter Name="MetaDescription" Type="String" />
            <asp:Parameter Name="MetaKeywork" Type="String" />
            <asp:Parameter Name="MetaRobots" Type="String" />
            <asp:Parameter Name="Order" Type="Int32" />
            <asp:Parameter Name="Status" Type="Boolean" />
            <asp:Parameter Name="Delete" Type="Boolean" />
            <asp:Parameter Name="Original_ProductID" Type="Int32" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    <br />
    <br />
</asp:Content>

